﻿<!--//=============================================================
    // Copyright (C) 2015 福流网络
    // 作 者：钟星星
    // 日 期：2016-02-17
    // 描 述:  海运制单主页面--新增按钮
    // 版 本：1.00
    // 修改历史纪录
    // 版 本  修改时间      修改人            修改内容
    //=============================================================-->



<div>
    <input id="textdept" name="dept" class="mini-hidden" />
</div>

<table id ="tabSelect">

    <tr>
        <td>
            报关日期
        </td>
        <td>
            <input id="start_apply_dt" name="start_apply_dt" class="mini-datepicker" style="width:95px;" />
            <input id="end_apply_dt" name="end_apply_dt" class="mini-datepicker" style="width:95px;" />
        </td>
        <td>
            创建日期
        </td>
        <td>
            <input id="start_receive_dt" name="start_receive_dt" class="mini-datepicker" style="width:95px;" />
            <input id="end_receive_dt" name="end_receive_dt" class="mini-datepicker" style="width:95px;" value="new Date()" />
        </td>
        <td>状态</td>
        <td>
            <input id="complete_yn" name="complete_yn" class="mini-combobox" shownullitem="true" style="width: 60px;"
                   data="[{id:0,text:'未交单'},{id:1,text:'已交单'}]" textfield="text" valuefield="id" value="0" />
        </td>

    </tr>
</table>

<table id="tabLYSelect">
    <tr>
        <td>
            创建日期
        </td>
        <td>
            <input id="start_receive_dt1" name="start_receive_dt1" class="mini-datepicker" style="width:95px;" />
            <input id="end_receive_dt1" name="end_receive_dt1" class="mini-datepicker" style="width:95px;" value="new Date()" />
        </td>
        <td>状态</td>
        <td>
            <input id="complete_yn1" name="complete_yn1" class="mini-combobox" shownullitem="true" style="width: 60px;"
                   data="[{id:0,text:'未交单'},{id:1,text:'已交单'}]" textfield="text" valuefield="id" value="0" />
        </td>
    </tr>
</table>
<table id="exportTab" style="display:none;">
    <tr>
        <td>
            模板名称
        </td>
        <td>
            <input class="mini-combobox" showclose="true"  style="width:200px;" id="comExport" url="/Share/GetJsonList?tablename=t_customer_fees_tmp&fieldnames=id,tmp_name&where=business_type=1&searchField=&datacount=100" textfield="tmp_name" valuefield="id" allowinput="false"  oncloseclick="onCloseClick" />
        </td>
    </tr>
</table>



<div id="dataBgTypeWindow" class="mini-window" title="选择报关类型" style="width: 300px; height: 400px;"
     showshadow="true" showtoolbar="true" showfooter="true" showmodal="false" allowresize="true" allowdrag="true">

    <div id="dataBgType" class="mini-datagrid" style="width: 100%; height: 300px;"
         allowresize="false"
         idfield="value"
         multiselect="false"
         showpager="false"
         onrowclick="fnBgType"
         editnextonenterkey="true" editnextrowcell="true">
        <div property="columns">
            <div type="checkcolumn"></div>
            <div type="indexcolumn">序号</div>
            <div field="name" width="80" headeralign="center" allowsort="false">报关类型</div>
            <div field="value" width="80" headeralign="center" allowsort="false" visible='false'>费用</div>
            <div field="description" width="260" headeralign="center" allowsort="false" visible='false'>文件夹</div>
        </div>
    </div>
    <div class='mini-toolbar' style="text-align:center;">
        <a id='btnCancel' onclick='fnCancleBgType()' class='mini-button'>取消</a>
    </div>

</div>



<div id="dataBgDepartmentWindow" class="mini-window" title="选择部门组别" style="width: 300px; height: 400px;"
     showshadow="true" showtoolbar="true" showfooter="true" showmodal="false" allowresize="true" allowdrag="true">

    <div id="dataBgDepartment" class="mini-datagrid" style="width: 100%; height: 300px;"
         allowresize="false"
         idfield="value"
         multiselect="false"
         showpager="false"
         onrowclick="fnBgDepartment"
         editnextonenterkey="true" editnextrowcell="true">
        <div property="columns">
            <div type="checkcolumn"></div>
            <div type="indexcolumn">序号</div>
            <div field="name" width="80" headeralign="center" allowsort="false">名称</div>
            <div field="id" width="80" headeralign="center" allowsort="false" visible='false'>id</div>
        </div>
    </div>
    <div class='mini-toolbar' style="text-align:center;">
        <a id='btnCancel' onclick='fnCancleDepartment()' class='mini-button'>取消</a>
    </div>

</div>


<script src="../../../Scripts/common/jquery.data.js"></script>
<script type="text/javascript">
    mini.parse();
    $().ready(function () {
        var date = mini.formatDate(new Date(), "yyyy-MM");
        mini.get("start_receive_dt").setValue(date + "-01");
        mini.get("start_receive_dt1").setValue(date + "-01");
    });
    /**********************************
        * add by zhy 2015-06-27 绑定报关类型
        **************************************/
    //新增报关单，页面跳转前，弹出用户选择框 add by zhuhy 2015-06-27
    //基于 jquery.data.js 取数
    //海陆空对应的报关类型关系
    //var transType = [{ "key": "01", "code": "bg_baoguanleixing" },//海运
    //    { "key": "02", "code": "bg_luyunbaoguanleixing" }//陆运
    //];
    //var codeData = Enumerable.From(transType).Where(function (i) {
    //    return i.key = transNo;
    //}).ToArray();
    //var dataType = fnGetData("v_data_base_dictionary_detail", "code = '" + codeData[0].code + "'", "value");
    //var bgType = dataType.data;
    //mini.get("dataBgType").setData(bgType);



    //选中报关单类型 add by zengtongchun 2015-10-18
    function fnBgType(e) {
        var prefix = "";
        var transData = fnGetEntityInstance("v_data_base_dictionary_detail", "code='bg_kouanleixing' and value='" + transNo + "'");
        if (transData != null) {
            prefix = transData.description;
        }
        if (isHw==1) {
            window.open("../../CustomsClearance/Create?description=" + e.row.description + "&prefix=" + prefix + "&bgType=" + e.row.value+"&isHw="+isHw, "_new");
        } else {
            window.open("../../CustomsClearance/Create?description=" + e.row.description + "&prefix=" + prefix + "&bgType=" + e.row.value, "_new");
        }
        
        win.hide();
    }

    function fnOpenUrl(num) {
       
    }

    function fnBgDepartment(e) {
        var deptId = e.row.id;
        mini.get("textdept").setValue(deptId);
        winDept.hide();
    }


    //关闭窗口
    function CloseWindow(action) {
        if (window.CloseOwnerWindow) return window.CloseOwnerWindow(action);
        else window.close();
    }

    //获取数据
    function GetData() {
        var dataBgType = mini.get("dataBgType");
        var rows = dataBgType.getSelecteds();
        return rows[0].description;
    }

    //取消
    function fnCancleBgType() {
        win.hide();
    }
    

    function fnCancleDepartment() {
        winDept.hide();
    }

</script>






<!--shownullitem="true"-->